Skip to content

cpuinfo: parse arm64 CPU implementer, variant, and part - #882

Merged
SuperQ merged 4 commits into
prometheus:masterfrom
AdamMagued:fix/issue-875-cpuinfo-arm64-parser-ignores-c
Oct 19, 2026
Merged

SuperQ merged 4 commits into
prometheus:masterfrom
AdamMagued:fix/issue-875-cpuinfo-arm64-parser-ignores-c

Conversation

@AdamMagued

Copy link
Copy Markdown
Contributor

Resolves #875.

Signed-off-by: Adam Magued <adamismailmageud@gmail.com>
@AdamMagued
AdamMagued force-pushed the fix/issue-875-cpuinfo-arm64-parser-ignores-c branch from 3c165a7 to e6b3490 Compare October 17, 2026 03:49

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting fails.

Comment thread cpuinfo_test.go Outdated
Fix linting issue

Signed-off-by: Ben Kochie <superq@gmail.com>
Comment thread cpuinfo.go Outdated
Comment on lines +235 to +244
updateStepping := func(idx int) {
v := variants[idx]
r := revisions[idx]
stepping := formatSteppingARM(v, r)
if idx == -1 {
commonCPUInfo.Stepping = stepping
} else {
cpuinfo[idx].Stepping = stepping
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of this inline function. Is there a cleaner way to handle this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to eliminate the inline closure completely. Variant and revision values are captured directly during scanning and stepping formatting is resolved in a single post-scanning pass across the parsed entries. Verified clean against unit tests and go vet.

Resolve ARM stepping values per core in a single post-scanning pass rather than invoking an inline closure repeatedly inside the scanner loop.

Signed-off-by: Adam Magued <adamismailmageud@gmail.com>

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@SuperQ

SuperQ commented Oct 19, 2026

Copy link
Copy Markdown
Member

👓 @rtreffer

@SuperQ
SuperQ merged commit 9a862ae into prometheus:master Oct 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cpuinfo: arm64 parser ignores CPU implementer/variant/part/revision, so CPU identity is empty on arm64 servers

3 participants